import table from '@/components/dt/table/render.js'
import dateOpt from '@/biz/option/date.js'
import Opt from '@/components/dt/info/Opt.js'
import dt from '@dt/dt'
import nameOpt from '@/biz/option/name.js'


let _this = null

class Column extends Opt {
  constructor(vm) {
    super()
    _this = vm
    this.build()
  }

  build() {
    this.createAll()
    this.opts.push(...this.all)
  }

  createAll() {
    this.all = [
      {
        field: 'userName',
        title: '顾问',
        minWidth: 180,
        header: {
          filter: {
            title: '顾问',
            key: 'nameOrWorkNo',
            placeholder: '请输入顾问姓名或工号',
            input: {},
          },
          // filter: nameOpt.createPeople({
          //   key: 'nameOrWorkNo',
          //   title: '顾问',
          //   placeholder: '请输入顾问姓名或工号',
          //   validate: 3,
          //   to: (info) => {
          //     return {
          //       userName: info.name,
          //       userId: info.userId
          //     }
          //   }
          // })
        },
        // slots: {
        //   default: (params, h) => {
        //     return table.cell.text(h, {
        //       value: `${params.row.userName}`
        //     })
        //   }
        // }
      },
      {
        title: '线索客户',
        field: 'clueNum',
        minWidth: 150,
      },
      {
        title: '回拨量',
        field: 'callBackNum',
        minWidth: 150,
      },
      {
        title: '未回拨',
        field: 'unCallBackNum',
        minWidth: 150,
      },
      {
        title: '平均回拨响应周期',
        field: 'averageCallBackRate',
        minWidth: 150,
      },
      {
        title: '平均通话时长',
        field: 'averageConnectedTime',
        minWidth: 150,
      },

      {
        title: '所属事业部',
        field: 'caseLocation',
        minWidth: 150,
      }, {
        title: '所属子公司',
        field: 'caseLocationTwo',
        minWidth: 150,
      }, {
        title: '所属事业处',
        field: 'department',
        minWidth: 150,
      }, {
        title: '所属案场',
        field: 'buildingName',
        minWidth: 150,
      }, {
        title: '所属城市',
        field: 'city',
        minWidth: 150,
      },
    ]
  }

}

export default Column